package com.chen.recruit.domain;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.chen.recruit.common.constants.SysConstants;
import com.chen.recruit.common.enums.CommonStatus;
import com.chen.recruit.common.valid.AddGroup;
import com.chen.recruit.common.valid.UpdateGroup;
import com.chen.recruit.domain.model.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 角色对象 t_role
 *
 * @author cgy
 * @date 2022-08-20
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class Role extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 角色ID
     */
    @Null(message = "新增角色id必须为空", groups = AddGroup.class)
    @NotNull(message = "更新角色id不能为空", groups = UpdateGroup.class)
    private Integer id;

    /**
     * 角色名称
     */
    @NotBlank(message = "角色名称不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Excel(name = "角色名称", width = 20)
    private String name;

    /**
     * 角色编码
     */
    @NotBlank(message = "角色名称不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Excel(name = "角色编码", width = 20)
    private String code;

    /**
     * 状态（1启用 0禁用）
     */
    @NotNull(message = "角色状态不能为空", groups = UpdateGroup.class)
    @Excel(name = "状态", width = 20, enumExportField = SysConstants.ENUM_EXPORT_FIELD)
    private CommonStatus status;

    /**
     * 备注
     */
    @Excel(name = "备注", width = 20)
    private String remark;

}
